home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 July & August / rerun-1986-07-08.d64 / disk keeper (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  8KB  |  215 lines

  1. 100 rem f$ and d$ must be first two program variables!
  2. 110 f$="":dimd$(200),d%(200):pr=4:elite=0:a$="-":b$=":"
  3. 120 poke53280,0:poke53281,0:fork=1to80:bl$=bl$+" ":next:bb$=mid$(bl$,1,9)
  4. 130 dimtp$(4):tp$(1)=" seq":tp$(2)=" prg":tp$(3)=" usr":tp$(4)=" rel"
  5. 140 dime$(2):e$(0)="":e$(1)="  ":e$(2)="   "
  6. 150 gosub9100:r=12:c=7:gosub9000:print"please wait--initializing";
  7. 160 j=0:fork=49152to49364:readn:j=j+n:pokek,n:next:poke49248,4
  8. 170 ifj<>29842thenprint"error in data statements 10000-10110:end
  9. 180 j[178]0:[129]k[178]828[164]866:[135]n:j[178]j[170]n:[151]k,n:[130]
  10. 190 [139]j[179][177]6665[167][153]"error in data statements 20000-20020:end
  11. 200 j=0:fork=50000to50098:readn:j=j+n:pokek,n:next
  12. 210 ifj<>14887thenprint"error in data statements 30000-30050:end
  13. 220 [141]9000:[153]bl$
  14. 230 [141]9100:[141] 9200
  15. 240 [145] x [137]6500,3000,8500,7100,7200,7500,5500,5000,9999
  16. 3000 [141]9100:[153][163]12)"make disk label":[141]9500:[139]er[177]19[167]230
  17. 3010 [153][163]12)"1) jacket insert"
  18. 3020 [153][163]12)"2) full jacket"
  19. 3030 [153][163]11)"choose format:    cmdcmd";:[141]9090:w[178]1:[141]8000:x[178][197](s$)
  20. 3040 [139]s$[178]"1"[176]s$[178]"2"[167]3070
  21. 3050 [139]s$[178]""[167]230
  22. 3060 [153]:[153][163]4)"choose a number between 1 and 2ononon":[137]3030
  23. 3070 g[178][197](s$)[171]1
  24. 3080 [153][163]4)" type in optional label string  ":r[178]14:c[178]8:w[178]24:[141]8000
  25. 3090 l$[178]s$:ff[178]1
  26. 3100 [141]9090:[153][163]11)"reading directory":[141]6000
  27. 3110 [141]9400:[151]781,r:[158]828:[153][163]16)"printing"
  28. 3120 [160]4:[159]4,pr:x$[178]"":[129]k[178]1[164]9:x$[178]x$[170]a$:[130]
  29. 3130 y$[178]b$[170]"        ":z$[178]"        "[170]b$:ww[178]54:d$(nf[170]1)[178][202](bl$,1,25):lm[178]22
  30. 3140 d$(nf[170]2)[178]d$(nf[170]1):[139]g[167]lm[178]lm[171]4:g[178]g[170]el:ww[178]ww[170]2[172][195](e$(g))
  31. 3150 [139][195](l$)[179]ww[171]2[172][195](e$(g))[171]29[167]l$[178]l$[170]"close":[137]3150
  32. 3160 f$[178]n$:[158]50046:[141]3500:[141]3600:[139]g[167][152]4,y$;
  33. 3170 l$[178]b$[170]e$(g)[170]"  "[170]f$[170]e$(g)[170]"    "[170]l$[170]b$:[152]4,l$;:[139]g[167][152]4,z$;
  34. 3180 [152]4:[141]3600:[141]3500:[141]3600:j[178][181](nf[173]2):[139]j[178]0[167]j[178]1
  35. 3190 [129]m[178]1[164]j:[139]g[167][152]4,y$;
  36. 3200 f$[178]d$(m):[158]50046:h$[178]f$:f$[178]d$(m[170]j):[158]50046
  37. 3210 [152]4,b$;e$(g);h$"  "f$;e$(g);b$;:[139]g[167][152]4,z$;
  38. 3220 [152]4:[139]m[179][177]17[176]g[178]0[167]3240
  39. 3230 [139]m[179][177]j[167][141]3600:[141]3500:y$[178]bb$:z$[178]y$:[141]3600:ff[178]0
  40. 3240 [130]m:[141]3800:[129]m[178]m[164]lm:[141]3600:[130]
  41. 3250 [139]ff[167][141]3500:[139]g[178]0[167]3290
  42. 3260 [139]g[178]0[167]3290
  43. 3270 g[178]0:[129]m[178]m[164]lm[170]27:[152]4,bb$;:[141]3600:[130]
  44. 3280 [152]4,bb$;:[141]3500
  45. 3290 [152]4:[160]4:[137]230
  46. 3500 [139]g[167][152]4,x$;
  47. 3510 [129]k[178]1[164]ww:[152]4,a$;:[130]:[139]g[167][152]4,x$;
  48. 3520 [152]4:[142]
  49. 3600 [139]g[167][152]4,y$;
  50. 3610 [152]4,b$;:[152]4,[202](bl$,1,ww[171]2);:[152]4,b$;:[139]g[167][152]4,z$;
  51. 3620 [152]4:[142]
  52. 3800 [141]3600:[139]g[167][152]4,y$;
  53. 3810 x[178](ww[171]17)[173]2:[152]4,b$[202](bl$,1,x)[202](bl$,1,4[171][195]([196](bf)));
  54. 3820 [152]4,bf"blocks free"[202](bl$,1,ww[171]x[171]17);b$;:[139]g[167][152]4,z$;
  55. 3830 [152]4:m[178]m[170]2:[142]
  56. 5000 [141]9100:[153][163]11)"send disk command"
  57. 5010 [153]"   type disk command and press return"
  58. 5020 r[178]10:c[178]2:w[178]36:[141]8000:[139]s$[178]""[167]230
  59. 5030 [141]9500:[152]15,s$:[141]9600
  60. 5040 [139]er[177]19[167][160]15:[137]230
  61. 5050 [153]:[153][163]19)"ok":x$[178][202](s$,1,1)
  62. 5060 [139]x$[178]"v"[176]x$[178]"s"[176]x$[178]"r"[176]x$[178]"n"[176]x$[178]"c"[167]nn$[178]""
  63. 5070 [160]15:[141]9800:[137]230
  64. 5500 [141]9100:[153][163]12)"format new disk"
  65. 5510 [153][163]8)"enter name for new disk":
  66. 5520 r[178]10:c[178]11:w[178]16:[141]8000:[139]s$[178]""[167]230
  67. 5530 sn$[178]s$:[153]"   enter unique two character disk id"
  68. 5540 r[178]14:c[178]18:w[178]2:[141]8000:[139]s$[178]""[167]230
  69. 5550 [139][195](s$)[179][177]2[167][153]"ononononon":[137]5530
  70. 5560 sd$[178]s$:[153][163]5)"warning!  formatting will erase"
  71. 5570 [153][163]5)"any existing files on the disk!"
  72. 5580 [153][163]8)"proceed with format?":r[178]19:c[178]30:w[178]1:[141]8000
  73. 5590 [139]s$[179][177]"y"[167]230
  74. 5600 [141]9700:[153][163]9)"formatting in progress"
  75. 5610 [160]15:[159]15,8,15:[152]15,"new0:"sn$","sd$:[160]15:nn$[178]"":[137]230
  76. 5999 [143] read disk directory into d$
  77. 6000 [141]9500:[139]er[167]230
  78. 6010 [141]8200:t[178]18:s[178]1:[139]n$[178]nn$[175]fp[178]0[167][160]3:[142]
  79. 6020 nn$[178]n$:[139]fp[178]0[167]nf[178]0
  80. 6030 [152]15,"b-p:3,4":bf[178]0:[129]k[178]1[164]35:[161]#3,x$
  81. 6040 [139]x$[179][177]""[175]k[179][177]18[167]bf[178]bf[170][198](x$)
  82. 6050 [161]#3,x$:[161]#3,x$:[161]#3,x$:[130]
  83. 6060 tt[178]t:ss[178]s:[152]15,"b-r:3,0";t;s:[152]15,"b-p:3,0"
  84. 6070 [161]#3,t$:t[178]0:[139]t$[179][177]""[167]t[178][198](t$)
  85. 6080 [161]#3,s$:s[178]0:[139]s$[179][177]""[167]s[178][198](s$)
  86. 6090 [129]k[178]0[164]7:[152]15,"b-p:3";k[172]32[170]2:[161]#3,x$:[139]x$[178]""[167]6210
  87. 6100 w[178][198](x$):y$[178]tp$(w[175]7):[139](w[175]128)[179][177]128[167]y$[178]"*"[170][202](y$,2)
  88. 6110 [139](w[175]64)[178]64[167]y$[178]y$[170]"<":[137]6130
  89. 6120 y$[178]y$[170]" "
  90. 6130 [152]15,"b-p:3";k[172]32[170]30:[161]#3,x$:b[178][198](x$):[161]#3,x$
  91. 6140 [139]x$[179][177]""[167]b[178]b[170]256[172][198](x$)
  92. 6150 c$[178][202]([196](b),2):[139][195](c$)[179]3[167]c$[178][202]("    ",1,3[171][195](c$))[170]c$
  93. 6160 [152]15,"b-p:3";k[172]32[170]5:[158]50000:[139]f$[179][177]ff$[176]fp[178]0[167]6200
  94. 6170 [152]15,"b-p:3";k[172]32[170]2:ex[178]0
  95. 6180 x[178]w[176]64:[139]fp[178]2[167]x[178]w[175]191
  96. 6190 [152]3,[199](x);:[152]15,"b-p:3,0":[152]15,"u2:3,0";tt;ss:[142]
  97. 6200 [139]fp[178]0[167]nf[178]nf[170]1:d$(nf)[178]c$[170]" "[170]f$[170]y$
  98. 6210 [130]k:[139]t[179][177]0[167]6060
  99. 6220 [160]3:[160]15:[142]
  100. 6500 [141]9100:[153][163]11)"display directory"
  101. 6510 [153][163]11)"reading directory":[141]6000:[141]9700
  102. 6520 [141]9400:k[178]1
  103. 6530 [141]9700:[153][163]11)""n$"":j[178]0:[139]nf[179]1[167]6550
  104. 6540 [153][163]7)d$(k):k[178]k[170]1:j[178]j[170]1
  105. 6550 [139] k[179][178]nf [175] j[179][177]10 [167]6540
  106. 6560 [139]k[177][178]nf[167][153][163]12)""bf"blocks free"
  107. 6570 [141] 9800:[139]x$[178]"*"[167]230
  108. 6580 [139]x$[178]"on"[176]x$[178]"^"[167]k[178]k[171]20:[139]k[179]1[167]k[178]1
  109. 6590 [139](k[179]nf)[176](k[178]1[175]x$[178]"on")[167]6530
  110. 6600 [137]230
  111. 7100 fp[178]1:p$[178]"protect":[137]7210
  112. 7200 fp[178]2:p$[178]"unprotect"
  113. 7210 [141]9100:[153][163]14[171]fp)""p$" file":[153][163]3[171]fp)"file to "p$": "
  114. 7220 w[178]16:r[178]10:c[178]21:[141]8000:ex[178]1:ff$[178]s$:sx$[178]s$:[139]s$[178]""[167]230
  115. 7230 [139][195](ff$)[179]16[167]ff$[178]ff$[170][199](160):[137]7230
  116. 7240 [141]6000:[153]
  117. 7250 [139]ex[178]0[167][153][163]13[171]fp[171][195](sx$)[173]2)""sx$" is now "p$"ed":nn$[178]"":[137]7270
  118. 7260 [153][163]11[171][195](sx$)[173]2)""sx$" is not on the disk"
  119. 7270 fp[178]0:[160]3:[160]15:[141]9800:[137]230
  120. 7500 [141]9100:[153][163]14)"rename disk":[141]9500:[139]er[177]19[167]230
  121. 7510 [141]8200:[153][163]11[171][195](n$)[173]2)"current disk name: "n$
  122. 7520 [153][163]7)"please input new disk name":r[178]13:c[178]12:w[178]16:[141]8000
  123. 7530 [139][195](s$)[178]0[167][160]3:[160]15:[137]230
  124. 7540 [139][195](s$)[179]16[167]s$[178]s$[170][199](160):[137]7540
  125. 7550 [152]15,"b-p:3,144":[152]3,s$;:[152]15,"u2:3,0,18,0":[160]3
  126. 7560 [141]9600:[139]er[177]19[167][160]3:[160]15:[137]230
  127. 7570 [153]:[153][163]9)"disk has been renamed":[152]15,"i0:":[160]15
  128. 7580 [129]k[178]1[164]3000:[130]:[137]230
  129. 8000 [141]9000:[153]"cmd>"[202](bl$,1,w)"wait<";:[141]9000:n[178]0:s$[178]""
  130. 8010 [151]204,0:[161]x$:[139]x$[178]""[167]8010
  131. 8020 [151]204,1:[151]212,0:x[178][198](x$):[139]x[179][177]13[167]8050
  132. 8030 [153]" ";:[139][195](s$)[178]w[167][153]"cmdwait<";
  133. 8040 [153]:[142]
  134. 8050 [139]x[179][177]20[176]n[178]0[167]8090
  135. 8060 n[178]n[171]1:s$[178][202](s$,1,n):[141]9000:[153]""s$;:[151]212,0:[153]"closeclosecmd";
  136. 8070 [139][195](s$)[178]w[171]1[167][153]"wait<";
  137. 8080 c[178]c[170]n:[141]9000:c[178]c[171]n:[137]8010
  138. 8090 [139]n[178]w[167]8010
  139. 8100 [139](x[177]31[175]x[179]129)[176](x[177]161)[167][153]x$;:s$[178]s$[170]x$:n[178]n[170]1
  140. 8110 [137]